﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OFB.BLL.Context;

namespace OFB.BLL.Repository
{
    public class ReportTrainerBLL : IRepository<Domain.Trainer>
    {
        private ReportTrainerContext context;

        public ReportTrainerBLL()
        {
            context = new ReportTrainerContext();
        }

        public ICollection<Domain.Trainer> FindAll()
        {
            //Gọi context Init(), truyền store procedure name là Report_GetAllTrainers
            //Map dữ liệu trả về cho class Trainer
            //return các object Trainer
            return context.Trainer.Init("Report_GetAllTrainers")
                .MapCollection<Domain.Trainer>().GetCollection();
        }
    }
}
